<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: PDM_PCM_v2   (PDM-PCM Converter v2)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__pdm__pcm__v2.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a>  </div>
  <div class="headertitle">
<div class="title">PDM_PCM_v2 (PDM-PCM Converter v2)</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<dl class="section note"><dt>Note</dt><dd>IP Supported: PDM </dd>
<dd>
Device Categories: CAT1B and CAT1D. Please refer <a href="usergroup1.html">Device Catalog</a>.</dd></dl>
<p>The pulse-density modulation to pulse-code modulation (PDM-PCM) driver provides an API to manage PDM-PCM conversion. A PDM-PCM converter is used to convert 1-bit digital audio streaming data to PCM data.</p>
<p>The functions and other declarations used in this driver are in cy_pdm_pcm_v2.h. You can include cy_pdl.h (ModusToolbox only) to get access to all functions and declarations in the PDL.</p>
<p>Features:</p><ul>
<li>Supports up to 8 PDM receivers</li>
<li>Supports Stereo/Mono dual mode PDM (pulse-density-modulated) to PCM (pulse-code-modulated) conversion</li>
<li>Half rate sampling to reduce system power consumption</li>
<li>CIC filter, FIR filter, DC block filter signal processing path</li>
<li>Programmable interface clock</li>
<li>Programmable FIR filter coefficients</li>
<li>Programmable CIC and FIR filter decimation</li>
<li>Programmable DC blocking coefficient</li>
<li>Programmable PCM word size (8, 10, 12, 14, 16, 18, 20, 24, 32 bits)</li>
<li>Programmable sampling delay, to cope with different master-slavemaster roundtrip delays</li>
<li>64 entry RX FIFO with interrupt and trigger support</li>
<li>Debug/freeze trigger support</li>
<li>Receiver activate trigger support</li>
<li>Test mode support, the IP includes a programmable PDM pattern generator</li>
</ul>
<p>Pulse-density modulation, or PDM, represents an analog signal with a binary signal. In a PDM signal, specific amplitude values are not encoded into codewords of pulses of different weight as they would be in pulse-code modulation (PCM); rather, the relative density of the pulses corresponds to the analog signal's amplitude. The output of a 1-bit DAC is the same as the PDM encoding of the signal.</p>
<p>Pulse-code modulation (PCM) is the method used to digitally represent sampled analog signals. It is the standard form of digital audio in computers, compact discs, digital telephony, and other digital audio applications. In a PCM stream, the amplitude of the analog signal is sampled regularly at uniform intervals, and each sample is quantized to the nearest value within a range of digital steps.</p>
<h1><a class="anchor" id="group_pdm_pcm_configuration_considerations_v2"></a>
Configuration Considerations</h1>
<p>To set up a PDM-PCM, provide the configuration parameters in the <a class="el" href="structcy__stc__pdm__pcm__config__v2__t.html">cy_stc_pdm_pcm_config_v2_t</a> structure.</p>
<p>Input frequency from source clock and the sampling rate Fs, is expressed as follows: <br />
 <b> CLK_IF_SRSS_FREQ = (CLOCK_CTL.CLOCK_DIV + 1) * M * Fs </b> <br />
 where M is the oversampling rate at the PDM source </p><div class="image">
<img src="pdm_pcm_sampling_rate.png" alt="pdm_pcm_sampling_rate.png"/>
</div>
<p>To initialize the PDM-PCM channels, call <a class="el" href="group__group__pdm__pcm__functions__v2.html#ga1392e066f0b764c9a71a9fc30bc6a33c">Cy_PDM_PCM_Channel_Init</a> function, providing the filled <a class="el" href="structcy__stc__pdm__pcm__channel__config__t.html">cy_stc_pdm_pcm_channel_config_t</a> structure To initialize the PDM-PCM block, call the <a class="el" href="group__group__pdm__pcm__functions__v2.html#ga26938ec1c8eb9fe737fffabfa68f33b4">Cy_PDM_PCM_Init</a> function, providing the filled <a class="el" href="structcy__stc__pdm__pcm__config__v2__t.html">cy_stc_pdm_pcm_config_v2_t</a> structure.</p>
<p>If you use a DMA, the DMA channel should be previously configured. PDM-PCM interrupts (if applicable) can be enabled by calling <a class="el" href="group__group__pdm__pcm__functions.html#gaecd6316cef42b4c9d31b38aad0c222e6">Cy_PDM_PCM_SetInterruptMask</a>.</p>
<p>For example, if the trigger interrupt is used during operation, the ISR should call the <a class="el" href="group__group__pdm__pcm__functions.html#ga93d86ba7f06b583502f1300eafde9783">Cy_PDM_PCM_ReadFifo</a> as many times as required for your FIFO payload. Then call <a class="el" href="group__group__pdm__pcm__functions__v2.html#ga9d8941e8d86fd989404a753e30dc91cd">Cy_PDM_PCM_Channel_ClearInterrupt</a> with appropriate parameters.</p>
<p>If a DMA is used and the DMA channel is properly configured, no CPU activity (or application code) is needed for PDM-PCM operation.</p>
<h1><a class="anchor" id="group_pdm_pcm_changelog_v2"></a>
Changelog</h1>
<table class="doxtable">
<tr>
<th>Version</th><th>Changes</th><th>Reason for Change </th></tr>
<tr>
<td>1.10 </td><td>Minor documentation updates. </td><td>Documentation enhancement.  </td></tr>
<tr>
<td>1.0 </td><td>Initial version </td><td></td></tr>
</table>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__pdm__pcm__macros__v2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__pdm__pcm__macros__v2.html">Macros</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__pdm__pcm__functions__v2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__pdm__pcm__functions__v2.html">Functions</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__pdm__pcm__data__structures__v2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__pdm__pcm__data__structures__v2.html">Data Structures</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__pdm__pcm__enums__v2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__pdm__pcm__enums__v2.html">Enumerated Types</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
